<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</h:head>
<body>
<ui:composition template="template.xhtml">
<ui:define name="conteudo">
	<h3>#{msgs['inicio.tweets']}</h3>
	<h:form id="tweets">
		<h:panelGroup id="regiaoC">
		<ui:repeat var="tweet" value="#{usuarioMB.usuario.todosTweets}">
			<div class="dados">
				<img src="default_img.png" />
				<span>#{tweet.usuario.nome} <strong class="hora">#{tweet.data}</strong></span>
				<span>#{tweet.mensagem}</span>
				
				<h:commandLink value="#{msgs['botao.retweetar']}" action="#{tweetMB.retweetar(tweet)}" rendered="#{tweet.usuario != usuarioMB.usuario}">
					<f:ajax event="action" execute="@form" render="@form"></f:ajax>
				</h:commandLink>
				<h:commandLink value="#{msgs['botao.excluir']}" action="#{tweetMB.remover(tweet)}" rendered="#{tweet.usuario == usuarioMB.usuario}">
					<f:ajax event="action" execute="@form" render="@form"></f:ajax>
				</h:commandLink>
			</div>
		</ui:repeat>
		</h:panelGroup>
	</h:form>
</ui:define>
</ui:composition>
</body>
</html>